package 面试真题;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author 帅小伙
 * @date 2022/1/28
 * @description
 */
public class Demo04贝壳找房2022java秋招笔试题2第1题 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        ArrayList<List<int[]>> list = new ArrayList<List<int[]>>();

        for (int i = 0; i < n; i++) {
            int k = scanner.nextInt();
            ArrayList<int[]> ints = new ArrayList<>();
            for (int j = 0; j < k; j++) {
                int l = scanner.nextInt();
                int r = scanner.nextInt();
                ints.add(new int[]{l,r});
            }
            list.add(ints);
        }
        int ans = 0;

        for (int i = 0; i < m; i++) {

        }
    }
}
